-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add support for APIGWv2 protocol (#64) #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
// TODO - is option 1 safe? If so, then it is the simpler approach | ||
// Option 1. join evt.cookies with semicolons | ||
// Option 2. reduce the list, parseing and merging into cookies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flagging TODO for feedback.
export function isALBResult(evt: ResponseResult, test: boolean): evt is ALBResult { | ||
// TODO - this type gaurd doesn't do any useful checking | ||
return test && 'statusCode' in evt; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flagging this TODO for feedback on this approach to using a type guard. Doesn't seem to be any attributes that can consistently be used to differentiate between the types. So seems like we can either:
A. Use a type guard like this.
B. Extend ALBResult to have an attribute we set to indicate if it is ALB, and then base the type guard on that attribute.
// make sure that undefined values don't break it: | ||
let evt2: RequestEvent = albRequest(); | ||
// TODO - this doesn't seem possible without encountering: error TS2790: The operand of a 'delete' operator must be optional. | ||
// // make sure that undefined values don't break it: | ||
// let evt2: RequestEvent = albRequest(); | ||
|
||
delete evt2.httpMethod; | ||
expect(evt2.httpMethod).to.strictlyEqual(undefined); | ||
expect(new Request(app, evt2, handlerContext()).method).to.strictlyEqual(''); | ||
// delete evt2.httpMethod; | ||
// expect(evt2.httpMethod).to.strictlyEqual(undefined); | ||
// expect(new Request(app, evt2, handlerContext()).method).to.strictlyEqual(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flagging this TODO for feedback. I think that this no longer works with the updated type definitions and needs to be removed.
I will split the package upgrades and related changes into a separate pull request, but figured it would be simpler to get initial feedback with all the changes together. |
No description provided.